﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NngLevelEditor.Manager;
using System.ComponentModel;

namespace NngLevelEditor.Entities
{
    public class Buckle : SpriteEntity
    {
        private int _countdown;

        [DescriptionAttribute("The time it takes for the buckle to close after opening. 0 signifies it does it close.")]
        public int Countdown
        {
            get { return _countdown; }
            set { _countdown = value; }
        }

        public Buckle()
        {
           //LoadContent();
        }

        public Buckle(string[] info)
        {
            LoadContent();

            Position = new Microsoft.Xna.Framework.Vector2(float.Parse(info[1]), float.Parse(info[2]));
            _type = int.Parse(info[3]);
            Rotation = float.Parse(info[4]);
            _countdown = int.Parse(info[5]);
        }

        public override void LoadContent()
        {
            _countdown = 0;
            _type = 1;
            _path = "entities/buckle/";

            base.LoadContent();
        }

        public override string GetFileString()
        {
            string fileString = "k " + _position.X + " " + _position.Y + " "
                              + _type + " " + Rotation + " " + _countdown;
            return fileString + base.GetFileString();
        }
    }
}
